import request from './request'
import { config } from '../config'
import { getHouseListMock } from '@/mock'


export const getHouseList = async (page: number, type: number) => {
  if(config.useMock){
    return getHouseListMock(page, type)
  }
  return request({
    url: `${config.baseUrl}/api/house/list?page=${page}&type=${type}`,
    method: 'GET'
  })
}

export const getHouseDetail = (id: string) => {
  return request({
    url: `${config.baseUrl}/api/house/detail/${id}`,
    method: 'GET'
  })
}